package com.sunlands.qdcy.tongzhuo.repository;

import com.sunlands.qdcy.tongzhuo.model.DiaryTopicDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author shixiaopeng
 */

@Repository
public interface DiaryTopicRepository extends JpaRepository<DiaryTopicDO, Long>, JpaSpecificationExecutor<DiaryTopicDO> {

    List<DiaryTopicDO> findAllByUserIdOrderByUpdateTimeDesc(long userId);

    DiaryTopicDO findByTopic(String topic);

}
